package com.fjsh.bean;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * 此处定义交给oauth2管理的用户信息，需要的属性可自行添加
 * 用户登录时会通过UserDetailsService存入
 */
@Setter @Getter
public class LoginUser extends User {

    private static final long serialVersionUID = -7508349050976937763L;

    private Long userId;

    public LoginUser(Long userId, String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);

        this.userId = userId;
    }

}
